using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.Sterilizationcenter.Domain.zmc
{
    /// <summary>
    /// 病房信息表
    /// </summary>
    [SugarTable("Ward")]
    public class Ward
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 病房编号
        /// </summary>
        [SugarColumn(Length = 50)]
        public string WardNo { get; set; }

        /// <summary>
        /// 病房名称
        /// </summary>
        [SugarColumn(Length = 100)]
        public string WardName { get; set; }

        /// <summary>
        /// 所属科室ID
        /// </summary>
        public int DepartmentId { get; set; }

        /// <summary>
        /// 所属科室名称
        /// </summary>
        [SugarColumn(Length = 100)]
        public string DepartmentName { get; set; }

        /// <summary>
        /// 床位总数
        /// </summary>
        public int BedCount { get; set; }

        /// <summary>
        /// 当前入住人数
        /// </summary>
        public int CurrentPatientCount { get; set; }

        /// <summary>
        /// 床位类型（0:单人间, 1:双人间, 2:多人间）
        /// </summary>
        public int BedType { get; set; }

        /// <summary>
        /// 责任护士ID
        /// </summary>
        public int NurseId { get; set; }

        /// <summary>
        /// 责任护士姓名
        /// </summary>
        [SugarColumn(Length = 50)]
        public string NurseName { get; set; }

        /// <summary>
        /// 是否空置（根据CurrentPatientCount和BedCount计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool IsEmpty => CurrentPatientCount == 0;

        /// <summary>
        /// 是否满床（根据CurrentPatientCount和BedCount计算）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public bool IsFull => CurrentPatientCount >= BedCount;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }
}